<?php
ob_end_clean();
header("Content-Type: text/html;charset=utf-8"); 
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");

$conn = mysql_connect("55d590833e9ca.gz.cdb.myqcloud.com:7630","cdb_outerroot","eshare123mysql") or die("无法连接数据库");
mysql_select_db("newdichan_exweixin",$conn);
mysql_set_charset('utf8',$conn);
$sql = "SELECT * FROM hfd_signup1";
$result = mysql_query($sql,$conn);
while ($row = mysql_fetch_array($result)){
    echo $row[4]."\t".$row[5]."\t".$row[6]."\t".$row[7]."\t\n";
}
$sql2="SELECT *FROM hfd_signup2";
$result2 = mysql_query($sql2,$conn);
while ($row = mysql_fetch_array($result2)){
    echo $row[4]."\t".$row[5]."\t".$row[6]."\t".$row[7]."\t\n";
}
?>